package com.idealighter.game.games.zjh.dto;

import com.baidu.bjf.remoting.protobuf.FieldType;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

@Data
public class GameInfo {
  @Protobuf(order = 1)
  private int stage; // 游戏阶段(0:准备阶段，1：第一轮下注阶段, 2:未超过top的下注阶段, 3:超过top阶段)
  // 用户情况
  @Protobuf(order = 2)
  private List<PlayerItem> playerInfoList = new ArrayList<PlayerItem>();
  // 下一个操作的玩家
  @Protobuf(order = 3)
  private Long nextOpsPlayer = 0L; // 下一个操作的玩家编号
  // 上一家下注金币
  @Protobuf(order = 4)
  private Long preBet = 0L;
  @Protobuf(order = 5)
  private Integer preDardk = 0; // 上一家是否下暗柱
  @Protobuf(order = 6)
  private Long totalBetChips = 0L; // 总下注金币
  // 我自己的牌
  @Protobuf(order = 7)
  private MySelfCard mySelfCard;
  //

  @Data
  public static class PlayerItem {
    @Protobuf(order = 1)
    private int order;
    // 状态(0:正常,1:弃牌,3:比牌失败)
    @Protobuf(order = 2)
    private int status;
    // 准备情况
    @Protobuf(order = 3)
    private int ready;
    // 总下注筹码
    @Protobuf(order = 4)
    private long totalBetChips = 0L;
    // 看牌情况
    @Protobuf(order = 5)
    private int seeCard;

    public static interface PlayerStatus {
      public static final int OK = 0;
      public static final int DISCARD = 1;
      public static final int OVER = 2;
    }
  }

  @Data
  public static class MySelfCard {
    // 牌型(0:235,1:单张,2:对子,3:顺子,4:金华,5:顺金,6:豹子)
    @Protobuf(order = 1)
    private int cardsType;
    // 牌
    @Protobuf(fieldType = FieldType.INT32, order = 2)
    private List<Integer> cards = new ArrayList<>();
  }
}
